package com.web.servlet;

import com.web.entity.Grade;
import com.web.service.GradeService;
import com.web.serviceimpl.GradeServiceImpl;
import java.io.IOException;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 根据学生学号查询成绩
 * @author 12270
 */
@WebServlet("/sosgs")
public class SearchOneStudentGradeServlet extends HttpServlet{
    
    GradeService gradeService = new GradeServiceImpl();
    
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp)
            throws ServletException, IOException {

        String sid = req.getParameter("sid");

        List<Grade> list = gradeService.findOneStudentGradeBySid(sid);
        
        req.setAttribute("grade", list);
        req.setAttribute("sid", sid);
        req.getRequestDispatcher("SearchStudentGrade.jsp").forward(req, resp);
    }
}
